import { http } from "@/utils/http";

/** 查询用户绑定列表 */
export const getTelegramUserList = (params: {
  keyword?: string;
  pageNum?: number;
  pageSize?: number;
  status?: boolean | string;
  notificationLevel?: string;
  receiveFiles?: boolean | string;
  userId?: number | string;
  telegramId?: string;
  orderBy?: string;
  orderDirection?: string;
}) => {
  return http.request<any>("get", "/api/admin/telegram/users", {
    params
  });
};
/** 查询用户绑定详情 */
export const getTelegramUserDetail = (userId: number) => {
  return http.request<any>("get", `/api/admin/telegram/users/${userId}`);
};
/** 强制解绑用户 */
export const unbindTelegramUser = (
  userId: number,
  params: {
    reason: string;
  }
) => {
  return http.request<any>(
    "post",
    `/api/admin/telegram/users/${userId}/unbind`,
    {
      params
    }
  );
};
/** 更新接受文件设置 */
export const updateAdminTelegramReceiveFiles = (
  userId: number,
  params: {
    receiveFiles: boolean;
  }
) => {
  return http.request<any>(
    "post",
    `/api/admin/telegram/users/${userId}/receive-files`,
    { params }
  );
};

/** 更新用户通知级别 */
export const updateAdminTelegramNotificationLevel = (
  userId: number,
  params: {
    level: string;
  }
) => {
  return http.request<any>(
    "post",
    `/api/admin/telegram/users/${userId}/notification-level`,
    {
      params
    }
  );
};
